package sctu.edu.java.year2016.team04.Liliang.day20160523.chapter4_3;

/**
 * Created by asus on 2016/5/23.
 * 编写Java程序，使用while循环语句计算1+1/2！+1/3！...1/20!之和.
 */
public class qiuheyunsuan {
    public static void main(String[] args) {
        int a = 0;
        double b = 0,c = 1;
        while(a<21){
            a++;
            c=a*c;
            b=b+1/c;
        }
        System.out.println("计算结果是："+b);
    }

}
